import 'package:flutter/material.dart';

class ListItem extends StatelessWidget {
  final double height;
  final Widget left;
  final Widget center;
  final Widget right;

  ListItem({
    Key key,
    this.height,
    this.left,
    this.center,
    this.right,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      height: height,
      child: Row(
        mainAxisAlignment: MainAxisAlignment.start,
        children: buildChildren(),
      ),
    );
  }

  buildChildren() {
    List<Widget> children = new List();
    left ?? children.add(left);
    center ?? children.add(Expanded(child: center,));
    right ?? children.add(right);
    return children;
  }
}
